<?php
	namespace app\models\first_pra;
	use yii\db\ActiveRecord;
	class article extends ActiveRecord{
		public function rules(){
			return [
				//['id','integer'],
				['title','required','message'=>'标题不能为空哦'],
				['title','string','min'=>2,'max'=>25,'tooShort'=>'标题不能小于2位','tooLong'=>'标题不能大于25位'],
				['description','required','message'=>'简介不能为空'],
				['description','string','max'=>100,'tooLong'=>'简介不能长于100位'],
				['content','required','message'=>'内容不能为空'],
				['content','string','min'=>10,'tooShort'=>'内容太短'],
				['flag','in','range'=>['0','1','2'],'message'=>'非法操作'],
				['status','in','range'=>['0','1'],'message'=>'非法操作'],
				['count','required','message'=>'浏览次数不能为空'],
				['count','integer','min'=>0,'tooSmall'=>'浏览次数不能低于0'],
			];
		}
	}
?>